package com.smh.springboottest.controller;

import com.smh.springboottest.dao.po.ControllerPo;
import com.smh.springboottest.dao.po.User;
import com.smh.springboottest.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author shiminghui
 * @date 2024/9/23 21:12
 * @description: TODO
 */
@Controller
@CrossOrigin
@RequestMapping()
public class TestController {

    @Autowired
    ControllerPo controllerPo;
    @Autowired
    UserService userService;


    @ResponseBody
    @GetMapping("/hello")
    public User hello(User user) {

        System.out.println(controllerPo);
        userService.add(user);

//        ModelAndView modelAndView = new ModelAndView("test");
        return user;
    }
}
